#!/usr/bin/python
# -*- coding: utf-8 -*-

"""
This example demonstrates how to handle a simple move event

example is from www.zetcode.com
"""

import wx

class Example(wx.Frame):
    
    def __init__(self, *args, **kwds):

        super(Example, self).__init__(*args, **kwds)
        
        self.InitUI()

    def InitUI(self):

        wx.StaticText(self, label='X:', pos=(10, 10))
        wx.StaticText(self, label='Y:', pos=(10, 30))

        self.st1 = wx.StaticText(self, label='', pos=(30, 10))
        self.st2 = wx.StaticText(self, label='', pos=(30, 30))

        self.Bind(wx.EVT_MOVE, self.OnMove)

        self.SetSize((250, 180))
        self.SetTitle('Move Window')
        self.Center()
        self.Show()

    def OnMove(self, e):

        x, y = e.GetPosition()
        self.st1.SetLabel(str(x))
        self.st2.SetLabel(str(y))


if __name__ == '__main__':
    app = wx.App()
    Example(None)
    app.MainLoop()
